package com.example.execise1.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfig {
    private ApiInfo apiInfo(){
        return new ApiInfoBuilder().title("轻量级框架创新开发")
                .description("API文档")
                .contact(new Contact(
                        "陆心怡",
                        "http://coursescore.nj-agile.com",
                        "1027015257@qq.com"))
                .build();
    }
    @Bean
    public Docket createRestApi(){
        return new Docket(DocumentationType.OAS_30)
                .enable(true)
                .apiInfo(apiInfo())
                .select().paths(PathSelectors.ant("/api/**"))
                .build();
    }
}